package com.bms.hystrix.interfaces.zl;

import com.bms.hystrix.pojo.ZiLiao;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "ZHILIAOCLIENT")
public interface ZiLiaoHystrix {
    //查询全部
    @RequestMapping(value = "/ziLiao/chaXunAll",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map chaXunAll(@RequestParam(value = "ziLiao") ZiLiao ziLiao);

    //分页查询
    @RequestMapping(value = "/ziLiao/chaXunFenYe",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map chaXunFenYe(@RequestParam(value = "page") int page, String biaoTi, String shangChuanShiJian);

    //基于id查询
    @RequestMapping(value = "/ziLiao/chaXunById",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map chaXunById(@RequestParam(value = "id") Integer id);

    //基于id删除
    @RequestMapping(value = "/ziLiao/shanChuById",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map shanChuById(@RequestParam(value = "id") String id);

    //基于id更新数据
    @RequestMapping(value = "/ziLiao/gengXinById",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map gengXinById(@RequestBody @ApiParam(name = "ziLiao", value = "pojo模型", required = true) ZiLiao ziLiao);

    //新增数据
    @RequestMapping(value = "/ziLiao/xinZeng",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map xinZeng(@RequestBody @ApiParam(name = "ziLiao", value = "pojo模型", required = true) ZiLiao ziLiao);

    //浏览数量
    @RequestMapping(value = "/ziLiao/liuLanShuLiang",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map liuLanShuLiang(@RequestBody @ApiParam(name = "ziLiao", value = "pojo模型", required = true) ZiLiao ziLiao);

    //下载量
    @RequestMapping(value = "/ziLiao/xiaZaiLiang",method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map xiaZaiLiang(@RequestBody @ApiParam(name = "ziLiao", value = "pojo模型", required = true) ZiLiao ziLiao);
}
